#ifndef MOCHA_DETAIL_IMAGE_BUFFER_HPP_INCLUDED
#define MOCHA_DETAIL_IMAGE_BUFFER_HPP_INCLUDED

/**
 * @file
 */

#include <iostream>
#include <vector>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/stream.hpp>

namespace mocha { namespace detail {
template<typename T>
void fill_image_c_buffer(std::istream& in, std::vector<T>& buffer) {
	in >> std::noskipws;
	std::copy(std::istream_iterator<typename std::istream::char_type>(in), std::istream_iterator<typename std::istream::char_type>(), std::back_inserter(buffer));
}
template<typename T, typename U>
void fill_image_c_buffer(boost::iostreams::stream<T>& in, std::vector<U>& buffer) {
	boost::iostreams::copy(in, std::back_inserter(buffer));
}
}}

#endif

